{% extends "base.html" %}

{% block title %}删除确认 - ExamPulse{% endblock %}

{% block content %}
<style>
    .delete-container {
        min-height: 80vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
        padding: 2rem 0;
    }

    .delete-card {
        border: none;
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        max-width: 450px;
        width: 100%;
    }

    .delete-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }

    .card-header-custom {
        background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
        color: white;
        padding: 1.5rem;
        text-align: center;
        border-bottom: none;
        position: relative;
    }

    .card-header-custom::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 12px solid #ee5a52;
    }

    .warning-icon {
        font-size: 4.5rem;
        color: #ff6b6b;
        margin-bottom: 1.5rem;
        animation: pulse 2s infinite;
        text-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    }

    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }

    .student-info {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 1.25rem;
        margin: 1.5rem 0;
        border-left: 4px solid #4361ee;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    }

    .student-name {
        color: #2b2d42;
        font-weight: 700;
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .btn-delete {
        background: linear-gradient(135deg, #e63946 0%, #d00000 100%);
        border: none;
        border-radius: 50px;
        padding: 0.75rem 2rem;
        font-weight: 600;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(230, 57, 70, 0.4);
        width: 100%;
        margin-bottom: 1rem;
    }

    .btn-delete:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(230, 57, 70, 0.5);
        background: linear-gradient(135deg, #d00000 0%, #b30000 100%);
    }

    .btn-cancel {
        background: white;
        border: 2px solid #6c757d;
        color: #6c757d;
        border-radius: 50px;
        padding: 0.75rem 2rem;
        font-weight: 600;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        width: 100%;
    }

    .btn-cancel:hover {
        background: #6c757d;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
    }

    .warning-text {
        color: #6c757d;
        font-size: 0.95rem;
        margin-top: 1.5rem;
        line-height: 1.5;
    }

    .security-notice {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
        font-size: 0.9rem;
        color: #8e9aaf;
    }
</style>

<div class="delete-container">
    <div class="row justify-content-center w-100">
        <div class="col-md-8 col-lg-6 col-xl-5">
            <div class="card delete-card">
                <div class="card-header-custom">
                    <h4 class="card-title mb-0">
                        <i class="fas fa-exclamation-triangle me-2"></i>确认删除学生
                    </h4>
                </div>
                <div class="card-body text-center py-4 px-4 px-md-5">
                    <div class="warning-icon">
                        <i class="fas fa-user-times"></i>
                    </div>
                    <h4 class="mb-3">确定要删除这名学生吗？</h4>

                    <div class="student-info">
                        <p class="text-muted mb-2">即将删除的学生</p>
                        <p class="student-name">{{ student.name }}</p>
                    </div>

                    <div class="alert alert-warning border-warning d-flex align-items-center" role="alert">
                        <i class="fas fa-info-circle me-2 text-warning"></i>
                        <div class="text-start">
                            <strong>警告：</strong>此操作不可逆转，所有相关数据将被永久删除。
                        </div>
                    </div>

                    <form method="post" class="mt-4">
                        {% csrf_token %}
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-delete">
                                <i class="fas fa-trash me-2"></i>确认删除
                            </button>
                            <a href="{% url 'users:student_list' %}" class="btn btn-cancel">
                                <i class="fas fa-times me-2"></i>取消操作
                            </a>
                        </div>
                    </form>

                    <p class="warning-text">
                        删除学生将移除其在系统中的所有记录，包括成绩、考试记录等关联数据。
                    </p>

                    <div class="security-notice">
                        <i class="fas fa-shield-alt"></i>
                        <span>出于安全考虑，此操作需要二次确认</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}